package Visitor;

import Entities.Advantages.DecreaseBallSpeed;
import Entities.Advantages.DecreaseBarSize;
import Entities.Advantages.IAdvantage;
import Entities.Advantages.IncreaseBallSpeed;
import Entities.Advantages.IncreaseBarSize;
import Entities.Advantages.MissileAdvantage;
import Entities.Advantages.ThreeBallsAdvantage;
import Entities.Ball;
import Entities.Bar;
import Entities.Boundary;
import Entities.Brick;
import Entities.Drawable;
import Entities.Hinder;
import Entities.Missile;

public class MissileCollisionVisitor implements IVisitor{
    private Missile missile;
    
    public MissileCollisionVisitor(Missile missile){
        this.missile = missile;
    }

    @Override
    public Drawable visit(Bar bar) {
        return null;
    }

    @Override
    public Drawable visit(Ball ball) {
        return null;
    }

    @Override
    public Drawable visit(Boundary boundary) {
        if (boundary.getY() > missile.getY()){
            return boundary;
        }
        return null;
    }

    @Override
    public Drawable visit(IAdvantage advantage) {
        return null;
    }

    @Override
    public Drawable visit(Brick brick) {
        if (brick.getY() + brick.getHeight() > missile.getY()){
            if (brick.getX() < missile.getX() + missile.getWidth() / 2 && missile.getX() + missile.getWidth() / 2 < brick.getX() + brick.getWidth()){
                return brick;
            }
        }
        return null;
    }

    @Override
    public Drawable visit(Drawable drawable) {
        return null;
    }

    @Override
    public Drawable visit(Hinder hinder) {
        return null;
    }

    @Override
    public Drawable visit(DecreaseBarSize dicreaseBarSize) {
        return null;
    }

    @Override
    public Drawable visit(IncreaseBarSize increaseBarSize) {
        return null;
    }

    @Override
    public Drawable visit(DecreaseBallSpeed drecreaseBallSpeed) {
        return null;
    }

    @Override
    public Drawable visit(IncreaseBallSpeed increaseBallSpeed) {
        return null;
    }

    @Override
    public Drawable visit(MissileAdvantage missileAdvantage) {
        return null;
    }

    @Override
    public Drawable visit(ThreeBallsAdvantage threeBallsAdvantage) {
        return null;
    }
    
}
